<template>
  <div class="lefts">
    <div class="lefts-content">
      <el-menu
        :default-active="$route.meta.navActive"
        class="el-menu-vertical-demo"
        :router="true"
        background-color="#001529"
        text-color="#fff"
        active-text-color="#1990ff"
      >
        <el-menu-item
          v-if="role !== 2"
          index="/indexPage"
        >
          <i class="el-icon-s-custom"></i>
          <span slot="title">首页</span>
        </el-menu-item>
        <el-menu-item
          v-if="role !== 2"
          index="/TeacherList"
        >
          <i class="el-icon-s-custom"></i>
          <span slot="title">讲师列表</span>
        </el-menu-item>
        <el-menu-item index="/LectureList">
          <i class="el-icon-s-platform"></i>
          <span slot="title">讲座列表</span>
        </el-menu-item>
        <el-menu-item
          v-if="role === 1"
          index="/AdminList"
        >
          <i class="el-icon-user"></i>
          <span slot="title">管理员账号</span>
        </el-menu-item>
        <el-menu-item
          v-if="role !== 2"
          index="/CompanyList"
        >
          <i class="el-icon-office-building"></i>
          <span slot="title">单位列表</span>
        </el-menu-item>
        <el-menu-item
          v-if="role === 1"
          index="/SearchTeach"
        >
          <i class="el-icon-office-building"></i>
          <span slot="title">宣讲查询</span>
        </el-menu-item>
      </el-menu>
    </div>
  </div>
</template>

<script>
import { getToken, setToken, getName, setName } from "@/utils/auth";
export default {
  data() {
    return {
      role: "",
    };
  },

  created() {
    this.role = getToken() - 0;
  },
  methods: {},
};
</script>

<style lang="scss">
.lefts {
  background: #001529;
  left: 0;
  top: 0;
}
.lefts-content {
}
.lefts-content::-webkit-scrollbar {
  /*滚动条整体样式*/
  width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
  height: 1px;
}

.lefts-content::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  background: #ccc; /*滚动条颜色*/
}

.lefts-content::-webkit-scrollbar-track {
  /*滚动条里面轨道*/
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: #ededed;
}
.el-menu {
  width: 190px;
}
.el-menu-item-group > ul {
  padding-left: 23px;
  .el-menu-item {
    min-width: auto;
  }
}
.lefts-top {
  height: 60px;
  line-height: 60px;
  font-size: 18px;
  font-weight: bold;
  padding-left: 24px;
  color: #fff;
}
.el-menu {
  border-right: none;
}
</style>
